﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Diagnostics;

namespace WebRPG
{
    public partial class Main1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Process[] processes = Process.GetProcessesByName("ServerRPG");

                if (processes.Length > 0)
                {
                    Label1.Style.Add("color", "green");
                    Label1.Text = "online";
                }
                else
                {
                    Label1.Style.Add("color", "red");
                    Label1.Text = "offline";
                }
            }
        }
    }
}